import os


def find_files(directory, target) -> str:
    for root, dirs, files in os.walk(directory):
        for file in files:
            if target in file:
                return os.path.join(root, file)
    return None


def get_file_lines_count(file_path):
    from itertools import takewhile, repeat

    buffer = 1024 * 1024
    with open(file_path, "r") as file:
        buf_gen = takewhile(lambda x: x, (file.read(buffer) for _ in repeat(None)))
        return sum(buf.count("\n") for buf in buf_gen)
